/**
 * \file CSocieteFrm.h
 * \author Corentin Le Bail
 * \date 2009-2012
 * \brief Fichier de déclaration de la class CSocieteFrm
 */
//------------------------------------------------------------------------------
#ifndef __CSOCIETEFRM_H__
#define __CSOCIETEFRM_H__
//------------------------------------------------------------------------------
#include "CMyMainWindow.h"
#include <QMenu>
#include <QAction>
#include "CMainFrm.h"
#include "ui_CSocieteFrm.h"
//------------------------------------------------------------------------------
/**
 * \class CSocieteFrm CSocieteFrm.h "CSocieteFrm.h"
 * \brief Classe de la fenêtre des sociétés.
 */
class CSocieteFrm : public CMyMainWindow, private Ui::SocieteFrm
{
	Q_OBJECT
	public:
		/**
		 * \fn CSocieteFrm(QString name, QString lastCode, CMainFrm *parent = 0)
		 * \brief Constructeur
		 * \param[in] name Nom de l'objet
		 * \param[in] lastCode Dernier code traité
		 * \param[in] parent Référence vers un objet parent
		 */
		CSocieteFrm(QString name, QString lastCode, CMainFrm *parent = 0);
	private:
		CGlobal::EAction actionCur;
		QString mailTemplate;
		CMainFrm *mainFrm;
		QMenu *popupMenu;
		QAction *actAddImage;
		QAction *actDropImage;
		bool pictureChange;
		QByteArray pictureData;
		
		void setActionCur(CGlobal::EAction action);
		CGlobal::EAction getActionCur(void); 
		void closeEvent(QCloseEvent * event);
		void makeRequete(QString &requete, QString &alias);
		void showFormulaire(QSqlQuery *query, CGlobal::EAction& action);
		void loadImage(QImage image);
		void makeActions(void);
		void makeMenu(void);
	private slots:
		void on_actAjouter_triggered(void);
		void on_actValider_triggered(void);
		void on_actAnnuler_triggered(void);
		void on_actSupprimer_triggered(void);
		void onChange(void);
		void on_actRechercheUneFiche_triggered(void);
		void onCombo(CMyComboBox *comboBox);
		void onInvokeHelp(CChamp *champ);
		void on_logo_customContextMenuRequested(const QPoint & pos);
		void actAddImage_triggered();
		void actDropImage_triggered();
};
//------------------------------------------------------------------------------
#endif //__CSOCIETEFRM_H__
//------------------------------------------------------------------------------